﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="_14073716_Prototype._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2 style="font-family: 'Times New Roman', Times, serif; font-size: xx-large; color: #FF6600">
        Welcome to Chinese Food!
    <a href="Rss.aspx"><img src="/Images/feed-icon-28x28.png" border="0"></a></h2>
    <br />
        There are many delicious Chinese food on this website.
    <br />
    <br />
    <br />
        <div style="float:left; width:189px; height: 426px;">
        <asp:FormView ID="FormView1" runat="server" BackColor="#DEBA84" 
            BorderColor="#DEBA84" BorderStyle="Double" BorderWidth="1px" CellPadding="3" 
            CellSpacing="2" DataKeyNames="ID" DataSourceID="SqlDataSource1" 
            GridLines="Both">
            <EditItemTemplate>
                ID:
                <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
                <br />
                ChineseFoodName_English:
                <asp:TextBox ID="ChineseFoodName_EnglishTextBox" runat="server" 
                    Text='<%# Bind("ChineseFoodName_English") %>' />
                <br />
                AreaOfOrigin_English:
                <asp:TextBox ID="AreaOfOrigin_EnglishTextBox" runat="server" 
                    Text='<%# Bind("AreaOfOrigin_English") %>' />
                <br />
                Picture:
                <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
                <br />
                CountOfTravellerName:
                <asp:TextBox ID="CountOfTravellerNameTextBox" runat="server" 
                    Text='<%# Bind("CountOfTravellerName") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
            <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
            <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
            <InsertItemTemplate>
                ChineseFoodName_English:
                <asp:TextBox ID="ChineseFoodName_EnglishTextBox" runat="server" 
                    Text='<%# Bind("ChineseFoodName_English") %>' />
                <br />
                AreaOfOrigin_English:
                <asp:TextBox ID="AreaOfOrigin_EnglishTextBox" runat="server" 
                    Text='<%# Bind("AreaOfOrigin_English") %>' />
                <br />
                Picture:
                <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
                <br />
                CountOfTravellerName:
                <asp:TextBox ID="CountOfTravellerNameTextBox" runat="server" 
                    Text='<%# Bind("CountOfTravellerName") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>
                The most viewed food:<br />
                <br />
                ChineseFoodName_English:<br />
                <asp:Label ID="ChineseFoodName_EnglishLabel" runat="server" 
                    ForeColor="#FF6600" Text='<%# Bind("ChineseFoodName_English") %>' />
                <br />
                <br />
                AreaOfOrigin_English:
                <asp:Label ID="AreaOfOrigin_EnglishLabel" runat="server" 
                    ForeColor="#FF6600" Text='<%# Bind("AreaOfOrigin_English") %>' />
                <br />
                <br />
                Picture:<br />
                <asp:ImageButton ID="ImageButton3" runat="server" Height="150px" 
                    ImageUrl='<%# Eval("Picture", "{0}") %>' 
                    PostBackUrl='<%# Eval("ID", "ChineseFoodDetail.aspx?ID={0}") %>' 
                    Width="150px" />
                <br />
                <br />
                Viewed by:
                <asp:Label ID="CountOfTravellerNameLabel" runat="server" ForeColor="#FF6600" 
                    Text='<%# Bind("CountOfTravellerName") %>' />
                <br />
            </ItemTemplate>
            <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
            <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        </asp:FormView>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ChineseFoodConn %>" 
            ProviderName="<%$ ConnectionStrings:ChineseFoodConn.ProviderName %>" 
            
                SelectCommand="SELECT DISTINCT * FROM [CountOfFoodAndView] ORDER BY [CountOfTravellerName] DESC, [ID]">
        </asp:SqlDataSource>
        </div>

        <div style="float:left; width:170px; height: 423px; margin-top: 0px; margin-left: 40px;">
        
            <asp:FormView ID="FormView2" runat="server" DataKeyNames="ID" 
                DataSourceID="SqlDataSource2" BackColor="White" BorderColor="#999999" 
                BorderStyle="Double" BorderWidth="1px" CellPadding="3" GridLines="Vertical" 
                style="margin-left: 8px; margin-top: 0px">
                <EditItemTemplate>
                    ID:
                    <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
                    <br />
                    ChineseFoodName_English:
                    <asp:TextBox ID="ChineseFoodName_EnglishTextBox" runat="server" 
                        Text='<%# Bind("ChineseFoodName_English") %>' />
                    <br />
                    ChineseFoodName_Chinese:
                    <asp:TextBox ID="ChineseFoodName_ChineseTextBox" runat="server" 
                        Text='<%# Bind("ChineseFoodName_Chinese") %>' />
                    <br />
                    AreaOfOrigin_English:
                    <asp:TextBox ID="AreaOfOrigin_EnglishTextBox" runat="server" 
                        Text='<%# Bind("AreaOfOrigin_English") %>' />
                    <br />
                    AreaOfOrigin_Chinese:
                    <asp:TextBox ID="AreaOfOrigin_ChineseTextBox" runat="server" 
                        Text='<%# Bind("AreaOfOrigin_Chinese") %>' />
                    <br />
                    Hot:
                    <asp:CheckBox ID="HotCheckBox" runat="server" Checked='<%# Bind("Hot") %>' />
                    <br />
                    Vegetarian:
                    <asp:CheckBox ID="VegetarianCheckBox" runat="server" 
                        Checked='<%# Bind("Vegetarian") %>' />
                    <br />
                    Picture:
                    <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
                    <br />
                    AreaOfOriginUrl_English_GoogleMap:
                    <asp:TextBox ID="AreaOfOriginUrl_English_GoogleMapTextBox" runat="server" 
                        Text='<%# Bind("AreaOfOriginUrl_English_GoogleMap") %>' />
                    <br />
                    ChineseFoodUrl_English_Wikipedia:
                    <asp:TextBox ID="ChineseFoodUrl_English_WikipediaTextBox" runat="server" 
                        Text='<%# Bind("ChineseFoodUrl_English_Wikipedia") %>' />
                    <br />
                    ChineseFoodUrl_Chinese_Baidu:
                    <asp:TextBox ID="ChineseFoodUrl_Chinese_BaiduTextBox" runat="server" 
                        Text='<%# Bind("ChineseFoodUrl_Chinese_Baidu") %>' />
                    <br />
                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="更新" />
                    &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="取消" />
                </EditItemTemplate>
                <EditRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                <InsertItemTemplate>
                    ChineseFoodName_English:
                    <asp:TextBox ID="ChineseFoodName_EnglishTextBox" runat="server" 
                        Text='<%# Bind("ChineseFoodName_English") %>' />
                    <br />
                    ChineseFoodName_Chinese:
                    <asp:TextBox ID="ChineseFoodName_ChineseTextBox" runat="server" 
                        Text='<%# Bind("ChineseFoodName_Chinese") %>' />
                    <br />
                    AreaOfOrigin_English:
                    <asp:TextBox ID="AreaOfOrigin_EnglishTextBox" runat="server" 
                        Text='<%# Bind("AreaOfOrigin_English") %>' />
                    <br />
                    AreaOfOrigin_Chinese:
                    <asp:TextBox ID="AreaOfOrigin_ChineseTextBox" runat="server" 
                        Text='<%# Bind("AreaOfOrigin_Chinese") %>' />
                    <br />
                    Hot:
                    <asp:CheckBox ID="HotCheckBox" runat="server" Checked='<%# Bind("Hot") %>' />
                    <br />
                    Vegetarian:
                    <asp:CheckBox ID="VegetarianCheckBox" runat="server" 
                        Checked='<%# Bind("Vegetarian") %>' />
                    <br />
                    Picture:
                    <asp:TextBox ID="PictureTextBox" runat="server" Text='<%# Bind("Picture") %>' />
                    <br />
                    AreaOfOriginUrl_English_GoogleMap:
                    <asp:TextBox ID="AreaOfOriginUrl_English_GoogleMapTextBox" runat="server" 
                        Text='<%# Bind("AreaOfOriginUrl_English_GoogleMap") %>' />
                    <br />
                    ChineseFoodUrl_English_Wikipedia:
                    <asp:TextBox ID="ChineseFoodUrl_English_WikipediaTextBox" runat="server" 
                        Text='<%# Bind("ChineseFoodUrl_English_Wikipedia") %>' />
                    <br />
                    ChineseFoodUrl_Chinese_Baidu:
                    <asp:TextBox ID="ChineseFoodUrl_Chinese_BaiduTextBox" runat="server" 
                        Text='<%# Bind("ChineseFoodUrl_Chinese_Baidu") %>' />
                    <br />
                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                        CommandName="Insert" Text="插入" />
                    &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="取消" />
                </InsertItemTemplate>
                <ItemTemplate>
                    The newest food:<br />
                    <br />
                    Chinese Food Name:<br />
                    <asp:Label ID="ChineseFoodName_EnglishLabel" runat="server" Font-Size="Medium" 
                        ForeColor="#CC33FF" Text='<%# Bind("ChineseFoodName_English") %>' />
                    <br />
                    <br />
                    Area Of Origin:<br />
                    <asp:Label ID="AreaOfOrigin_EnglishLabel" runat="server" Font-Size="Medium" 
                        ForeColor="#CC33FF" Text='<%# Bind("AreaOfOrigin_English") %>' />
                    <br />
                    <br />
                    Picture:<br />
                    <asp:ImageButton ID="ImageButton2" runat="server" Height="150px" 
                        ImageUrl='<%# Eval("Picture", "{0}") %>' 
                        PostBackUrl='<%# Eval("ID", "ChineseFoodDetail.aspx?ID={0}") %>' 
                        Width="150px" />
                    <br />
                </ItemTemplate>
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
            </asp:FormView>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ChineseFoodConn %>" 
                ProviderName="<%$ ConnectionStrings:ChineseFoodConn.ProviderName %>" 
                SelectCommand="SELECT DISTINCT * FROM [ClassicChineseFood] ORDER BY [ID] DESC">
            </asp:SqlDataSource>
        
        </div>
</asp:Content>
